<!-- 优惠券弹窗 -->
<uni-popup ref="couponPopup" type="bottom">
    <view class="coupon-popup popup" @touchmove.prevent.stop>
        <view class="popup-header">
            <text class="tit">优惠券</text>
            <text class="iconfont iconclose" @click="closePopup('couponPopup')"></text>
        </view>
        <scroll-view scroll-y="true" class="popup-body" :class="{ 'safe-area': isIphoneX }">
            <view class="coupon-item" v-for="(couponItem, couponIndex) in orderPaymentData.shop_goods_list.coupon_list" :key="couponIndex" @click="selectCoupon(couponItem)">
                <view class="coupon-info">
                    <view class="info-wrap" :style="{ backgroundImage: 'url(' + $util.img('/upload/uniapp/coupon/bg_lingqu.png') + ')' }">
                        <view class="coupon-money">
                            <template v-if="couponItem.type == 'reward'">
                                    <text class="unit">{{ $lang('common.currencySymbol') }}</text>
                                    <text class="money">{{ parseFloat(couponItem.money) }}</text>
                                </template>
                            <template v-else-if="couponItem.type == 'discount'">
                                    <text class="money">{{ parseFloat(couponItem.discount) }}</text>
                                    <text class="unit">折</text>
                                </template>
                            <view class="at-least">
                                <template v-if="couponItem.at_least > 0">
                                        满{{ couponItem.at_least }}可用
                                    </template>
                                <template v-else>
                                        无门槛
                                    </template>
                            </view>
                        </view>
                    </view>
                    <view class="desc-wrap">
                        <view class="coupon-name">{{ couponItem.coupon_name }}</view>
                        <view v-if="couponItem.type == 'discount' && couponItem.discount_limit > 0" class="limit">最多可抵￥{{ couponItem.discount_limit }}</view>
                        <view class="time font-size-goods-tag">有效期：{{ $util.timeStampTurnTime(couponItem.end_time) }}</view>
                    </view>
                    <view class="iconfont" :class="orderPaymentData.coupon.coupon_id == couponItem.coupon_id ? 'iconyuan_checked color-base-text' : 'iconyuan_checkbox'"></view>
                </view>
            </view>
        </scroll-view>
        <view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
            <view class="confirm-btn color-base-bg" @click="popupConfirm('couponPopup')">确定</view>
        </view>
    </view>
</uni-popup>




// 显示店铺优惠券信息 openSiteCoupon() { this.tempData = { coupon: this.$util.deepClone(this.orderPaymentData.coupon) }; this.$refs.couponPopup.open(); }, // 选择优惠券 selectCoupon(item) { if (this.orderCreateData.coupon.coupon_id != item.coupon_id) { this.orderCreateData.coupon.coupon_id
= item.coupon_id; this.orderCreateData.coupon.coupon_money = item.money; } else { this.orderCreateData.coupon.coupon_id = 0; this.orderCreateData.coupon.coupon_money = '0.00'; } Object.assign(this.orderPaymentData, this.orderCreateData); this.$forceUpdate();
},